#version 430

layout(location = 0) in vec3 vPosition;
layout(location = 1) in vec2 vTexcoord;
layout(location = 2) in int vTextureIndex;
layout(location = 3) in vec4 vColor;
layout(location = 5) in mat4 InstMvp;
layout(binding=0) uniform sampler2D texs[8];
out vec2 Texcoord1;
out vec4 Color;
void main()
{
    gl_Position = InstMvp * vec4(vPosition,1);
    ivec2 sz = textureSize(texs[vTextureIndex],0);
    Texcoord1=(vTexcoord-0.5)*1.5;
    Texcoord1.s*=(sz.x/sz.y);
    Color=vColor;
}
